package com.yq.bdm.utils;

import java.util.HashMap;
import java.util.Map;

public class CommonConstants {

//	public final static String COMMUNITY_CODE = "112"; //
	
	public final static String USER_SESSION_KEY = "loginUser"; // 存储在session中的用户信息key
	public final static String USEREXT_SESSION_KEY = "loginUserExt"; // 存储在session中的用户信息key
	
	/**
	 * 状态常量
	 */
	public final static int SUCCESS = 0; // 成功
	public final static int FAILED = -1; // 失败
	public final static String SUCCESS_TEXT = "success"; // 成功
	public final static String FAILED_TEXT = "failed"; // 失败
	
	public final static String PRI_LOGIN_TIMEOUT = "loginTimeout";
	public final static String PRI_NO_PERMISSIONS = "noPermissions";
	public final static String FILE_PATH = "saveFilePath";//上传文件保存路径
	/**
	 * 学段常量
	 */
	public final static String STUDY_TYPE_PREFIX = "STUDY_TYPE_"; // 前缀
	public final static Integer STUDY_TYPE_1 = 1; // 表示小学
	public final static Integer STUDY_TYPE_2 = 2; // 表示初中
	public final static Integer STUDY_TYPE_3 = 3; // 表示高中

	/**
	 * mybatis 数据dao层
	 */
	public final static String DAO_PACKAGE_PREFIX = "com.yq.bdm.dao.";
	public final static String DAO_PACKAGE_SUFFX = "Mapper.";
	public final static String INSERT_BATCH = "insertBatch";
	public final static String UPDATE_BATCH = "updateBatch";
	public final static String DELETE_BATCH = "deleteBatch";
	public final static String INSERT = "insert";
	public final static String INSERT_SELECTIVE = "insertSelective";
	public final static String INSERT_BY_SELECT = "insertBySelect";
	public final static String UPDATE = "updateByPrimaryKey";
	public final static String UPDATE_SELECTIVE = "updateByPrimaryKeySelective";
	public final static String DELETE_PRIMARYKEY = "deleteByPrimaryKey";
	public final static String DELETE = "delete";
	public final static String SELECT_PRIMARYKEY = "selectByPrimaryKey";
	public final static String SELECT = "select";
	
	/**
	 * 批量提交数量
	 */
	public final static Integer BATCH_COUNT = 100;

	/**
	 * json 文件中的关键字 key
	 */
	public final static Map<String, Class<?>> jsonKey = new HashMap<String, Class<?>>();
	
	
	/**
	 * 活动表 状态
	 */
	public static Map activityStatusMap = null;
	public static final String ACTIVITY_STATUS_NEW    = "NEW";	// 活动新建 -报名中
	public static final String ACTIVITY_STATUS_START  = "ST";	// 活动开始 -举办中
	public static final String ACTIVITY_STATUS_END    = "ED";	// 活动结束 
	public static final String ACTIVITY_STATUS_EXPIRY = "EXPR";	// 活动过期
	public static final String ACTIVITY_STATUS_DELETE = "DEL";	// 活动删除
	
	/**
	 * 参与人员表 是否被邀请
	 */
	public static Map prtpIsInviteMap = null;
	public static final Long PRTP_IS_INVITE_YES = 0L;	// 是否被邀请  0 是
	public static final Long PRTP_IS_INVITE_NO  = 1L;	// 是否被邀请  1 否
	
	/**
	 * 用户操作类型：点赞
	 */
	public static final String PRAISE = "praise";
	
	/**
	 * 参与人员表 状态
	 */
	public static Map prtpStatusMap = null;
	public static final Long PRTP_STATUS_WAIT   = 0L;	// 等待审核
	public static final Long PRTP_STATUS_ACPT   = 1L;	// 审核通过
	public static final Long PRTP_STATUS_RJCT = 2L;	// 审核未通过
	
	/**
	 * 好友权限表 类型：1允许, 2拒绝
	 */
	public static final Long FRIEND_PERMISION_TYPE_ACPT = 1L;	// 允许
	public static final Long FRIEND_PERMISION_TYPE_RJCT = 2L;	// 拒绝
	
	/**
	 * 日志说说 类型：0说说, 1日志
	 */
	public static final int TYPE_FOR_DIARY = 1;	//日志
	public static final int TYPE_FOR_WORD = 0;	//说说
	
	/**
	 * 日志说说 类型：0非匿名, 1匿名
	 */
	public static final int ANONYMITY_TRUE = 1;	    //匿名
	public static final int ANONYMITY_FALSE = 0;	//非匿名
	
	/**
	 * 协会表 状态：0:待审核,1:审核通过，2:审核未通过
	 */
	public static Map clubStatusMap = null;
	public static final Integer CLUB_STATUS_WAIT = 0;		// 待审核
	public static final Integer CLUB_STATUS_ACPT = 1;		// 审核通过
	public static final Integer CLUB_STATUS_RJCT = 2;		// 审核未通过
	
	/**
	 * 问题表 状态：
	 */
	public static Map questionStatusMap = null;
	public static final String QUESTION_STATUS_NEW    = "NEW";		// 新建 
	public static final String QUESTION_STATUS_CLOSE  = "CLOSE";	// 关闭 
	public static final String QUESTION_STATUS_EXPIRY = "EXPR";		// 过期
	public static final String QUESTION_STATUS_DELETE = "DEL";		// 删除
	
	
	/**
	 * 回答表 状态
	 * '是否被采纳，1未被采纳，2已被采纳，默认为1',
	 */
	public static Map answerAcceptedMap = null;
	public static final Integer ANSWER_ACCEPTED_YES = 2;	// 已被采纳
	public static final Integer ANSWER_ACCEPTED_NO = 1;		// 未被采纳
	
	/**
	 * 分组类型：
	 * 1、好友分组，2、关注分组，3、聊天分组，4、活动分组
	 */
	public static final Integer GROUP_TYPE_FRIEND = 1;	// 好友分组
	public static final Integer GROUP_TYPE_FOLLOW = 2;		// 关注分组
	public static final Integer GROUP_TYPE_CHAT = 3;		// 聊天分组
	public static final Integer GROUP_TYPE_ACTIVI = 4;		// 活动分组
	
	public static Map getActivityStatusMap() {
		if (activityStatusMap == null) {
			activityStatusMap = new HashMap();
			activityStatusMap.put(ACTIVITY_STATUS_NEW   , "正在报名 ");
			activityStatusMap.put(ACTIVITY_STATUS_START , "举办中 ");
			activityStatusMap.put(ACTIVITY_STATUS_END   , "圆满结束");
			activityStatusMap.put(ACTIVITY_STATUS_EXPIRY, "活动已过期");
			activityStatusMap.put(ACTIVITY_STATUS_DELETE, "已删除");
		}
		return activityStatusMap;
	}
	public static Map getPrtpIsInviteMap() {
		if (prtpIsInviteMap == null) {
			prtpIsInviteMap = new HashMap();
			prtpIsInviteMap.put(PRTP_IS_INVITE_YES, "邀请");
			prtpIsInviteMap.put(PRTP_IS_INVITE_NO , "");
		}
		return prtpIsInviteMap;
	}
	
	public static Map getPrtpStatusMap() {
		if (prtpStatusMap == null) {
			prtpStatusMap = new HashMap();
			prtpStatusMap.put(PRTP_STATUS_WAIT, "待审核");
			prtpStatusMap.put(PRTP_STATUS_ACPT , "审核通过");
			prtpStatusMap.put(PRTP_STATUS_RJCT , "审核未通过");
		}
		return prtpStatusMap;
	}
	
	public static Map getClubStatusMap(){
		if (clubStatusMap == null) {
			clubStatusMap = new HashMap();
			clubStatusMap.put(CLUB_STATUS_WAIT, "待审核");
			clubStatusMap.put(CLUB_STATUS_ACPT , "审核通过");
			clubStatusMap.put(CLUB_STATUS_RJCT , "审核未通过");
		}
		return clubStatusMap;
		
	}
	
	public static Map getQuestionStatusMap(){
		if (questionStatusMap == null) {
			questionStatusMap = new HashMap();
			questionStatusMap.put(QUESTION_STATUS_NEW    , "发布中");
			questionStatusMap.put(QUESTION_STATUS_CLOSE  , "已关闭");
			questionStatusMap.put(QUESTION_STATUS_EXPIRY , "已过期");
			questionStatusMap.put(QUESTION_STATUS_DELETE , "已删除");
		}
		return questionStatusMap;
	}
	
	public static Map getAnswerAcceptedMap(){
		if (answerAcceptedMap == null) {
			answerAcceptedMap = new HashMap();
			answerAcceptedMap.put(ANSWER_ACCEPTED_YES , "已被采纳");
			answerAcceptedMap.put(ANSWER_ACCEPTED_NO  , "");
		}
		return answerAcceptedMap;
	}
	
	public static String DEFAULT_HEAD_IMAGE = "/images/missing_face.png";
	
	/**
	 * 数字0
	 */
	public static final int NUM_0 = 0x0;
	/**
	 * 数字1
	 */
	public static final int NUM_1 = 0x1;
	/**
	 * 数字2
	 */
	public static final int NUM_2 = 0x2;
	/**
	 * 数字3
	 */
	public static final int NUM_3 = 0x3;
	/**
	 * 数字5
	 */
	public static final int NUM_5 = 0x5;
	/**
	 * 数字10
	 */
	public static final int NUM_10 = 0x0a;
	/**
	 * 数字15
	 */
	public static final int NUM_15 = 0x0f;
	/**
	 * 数字20
	 */
	public static final int NUM_20 = 0x14;
	/**
	 * 数字50
	 */
	public static final int NUM_50 = 0x32;

	/**
	 * 数字100
	 */
	public static final int NUM_100 = 0x64;
}
